﻿using Cofe.Core.Logger;
using Cofe.Core.Property;
using Cofe.Core.Security;
using Cofe.Core.Session;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Cofe.Core.Interfaces
{
    public interface IVolumeRegistrar : ICofeService
    {
       
        #region Methods

        /// <summary>
        /// Construct a volume from a factory.     
        /// </summary>
        /// <param name="volume"></param>
        Task<IVolume> RegisterVolumeAsync(IVolumeInfo volInfo);

        /// <summary>
        /// Construct a volume from a factory.     
        /// </summary>
        /// <param name="volume"></param>
        IVolume RegisterVolume(IVolumeInfo volInfo);

        /// <summary>
        /// Remove all registered volumes.
        /// </summary>
        void RemoveVolume(string volumeId);

        /// <summary>
        /// Lookup a registered volume, using its key.
        /// </summary>
        /// <param name="listerKey"></param>
        /// <returns></returns>
        IVolume LookupVolume(string volumeId);

        /// <summary>
        /// Filter the volume list and return those passed the filter.
        /// </summary>
        /// <param name="filterFunc"></param>
        /// <returns></returns>
        IEnumerable<IVolume> LookupVolumes(Func<IVolume, bool> filterFunc, bool includeSystem = false); 


        #endregion

        #region Public Properties
        
        IVolumeFactory[] VolumeFactories { get; set; }
        IVolumeRegistrarBehaviorManager Behaviors { get; }
        //IEntryConstructor EntryConstructor { get; set; }
        //ISecurityManager SecurityManager { get; set; }        

        #endregion

    }
}
